export const formOptions = [
  {
    label: '车位号',
    prop: 'spaceNum',
    rules: [{ required: true, message: '车库类型不能为空' }],
  },
  // 1-子母车位 2-无障碍车位 3-标准车位 4-非标准车位 5-大车位
  {
    label: '车位类型',
    prop: 'type',
    type: 'select',
    options: [
      { label: '子母车位', value: 1 },
      { label: '无障碍车位', value: 2 },
      { label: '标准车位', value: 3 },
      { label: '非标准车位', value: 4 },
      { label: '大车位', value: 5 },
    ],
    rules: [{ required: true, message: '楼层名称不能为空' }],
  },
  {
    label: '是否新能源',
    prop: 'isNewEnergy',
    type: 'radio',
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 },
    ],
  },
  {
    label: '是否临停',
    prop: 'isTemporary',
    type: 'radio',
    options: [
      { label: '是', value: 1 },
      { label: '否', value: 0 },
    ],
  },
  {
    label: '楼层',
    prop: 'garageId',
    type: 'select',
    linkage: 'communityId',
    options: async (value) => {
      try {
        const res = await $request.post('/api-parking/parking/garage/QueryGarage', {
          params: {
            communityId: value.communityId,
            pageSize: 100,
            pageNum: 1,
          },
        })
        return (res.rows || []).map((item) => ({ label: item.floorName, value: item.id }))
      } catch (error) {
        return []
      }
    },
  },
  {
    label: '售价',
    prop: 'price',
    type: 'number',
    rules: [{ required: true, message: '售价不能为空' }],
  },
  {
    label: '原价',
    prop: 'originalPrice',
    type: 'number',
  },
  // (0-不可售 1-未售 2-已售 3-认筹 4-认购)
  {
    label: '车位状态',
    type: 'select',
    options: [
      { label: '不可售', value: 0 },
      { label: '未售', value: 1 },
      { label: '已售', value: 2 },
      { label: '认筹', value: 3 },
      { label: '认购', value: 4 },
    ],
    prop: 'status',
  },
  { label: '车位面积', prop: 'area', type: 'number', unit: 'm²' },
  { label: '车位图片', prop: 'imageUrl', type: 'image', limit: 1, span: 3 },
  { label: '备注', prop: 'remark', type: 'textarea', span: 3 },
]
